Skip to content

feat: database version query#309

Merged
Ryuk-me merged 1 commit into
datachecks:mainfrom
Ryuk-me:database_version_query
Jun 11, 2025
Merged

feat: database version query#309
Ryuk-me merged 1 commit into
datachecks:mainfrom
Ryuk-me:database_version_query

Conversation

@Ryuk-me

@Ryuk-me Ryuk-me commented Jun 11, 2025

Copy link
Copy Markdown
Member

User description

###Implements #

  • Query to get database version

Description

Summary Goes here.

Type of change

Delete irrelevant options.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Locally Tested
  • Needs Testing From Production

PR Type

Enhancement


Description

• Add database version query method to SQL datasources
• Implement version queries for SQL Server, Oracle, and PostgreSQL
• Support custom version queries with optional parameter
• Add Optional type import to all modified files


Changes walkthrough 📝

Relevant files
Enhancement
sql_datasource.py
Add database version query to base SQL datasource               

dcs_core/core/datasource/sql_datasource.py

• Add query_get_database_version method with SQL Server version query

• Import Optional type for method parameter
• Use SELECT @@version as
default query with custom query fallback

+12/-1   
oracle.py
Implement Oracle database version query                                   

dcs_core/integrations/databases/oracle.py

• Add query_get_database_version method with Oracle-specific query

Import Optional type for method parameter
• Use SELECT BANNER FROM
v$version as Oracle version query

+12/-1   
postgres.py
Implement PostgreSQL database version query                           

dcs_core/integrations/databases/postgres.py

• Add query_get_database_version method with PostgreSQL query
• Import
Optional type for method parameter
• Use SELECT version() as
PostgreSQL version query

+12/-1   

Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Summary by CodeRabbit

    • New Features
      • Added the ability to retrieve the database version for SQL, Oracle, and Postgres data sources via a new method. Users can now obtain the version information directly from each supported database type.

    @coderabbitai

    coderabbitai Bot commented Jun 11, 2025

    Copy link
    Copy Markdown

    Caution

    Review failed

    The pull request is closed.

    Walkthrough

    New methods for retrieving the database version have been added to the SQLDataSource, OracleDataSource, and PostgresDataSource classes. Each method accepts an optional custom SQL query, defaults to a database-specific version query if none is provided, executes it, and returns the version string or None if no result is found.

    Changes

    File(s) Change Summary
    dcs_core/core/datasource/sql_datasource.py Added query_get_database_version method to SQLDataSource with optional custom SQL query support.
    dcs_core/integrations/databases/oracle.py Added query_get_database_version method to OracleDataSource with Oracle-specific default query and docstring; updated typing imports.
    dcs_core/integrations/databases/postgres.py Added query_get_database_version method to PostgresDataSource with PostgreSQL-specific default query.

    Sequence Diagram(s)

    sequenceDiagram
        participant Caller
        participant DataSource
    
        Caller->>DataSource: query_get_database_version(optional_query)
        alt Custom query provided
            DataSource->>DataSource: Execute custom query
        else No custom query
            DataSource->>DataSource: Execute default version query
        end
        DataSource->>Caller: Return version string or None
    
    Loading

    Poem

    In tunnels of data, the rabbits now cheer,
    For versioning secrets are suddenly clear!
    With queries bespoke, or defaults in hand,
    Each database whispers, "Here’s where I stand."
    Oracle, Postgres, and SQL unite—
    To tell their own stories, in bytes shining bright!
    🐇✨


    📜 Recent review details

    Configuration used: CodeRabbit UI
    Review profile: CHILL
    Plan: Pro

    📥 Commits

    Reviewing files that changed from the base of the PR and between d657dc9 and 6972c7c.

    📒 Files selected for processing (3)
    • dcs_core/core/datasource/sql_datasource.py (2 hunks)
    • dcs_core/integrations/databases/oracle.py (2 hunks)
    • dcs_core/integrations/databases/postgres.py (2 hunks)
    ✨ Finishing Touches
    • 📝 Generate Docstrings

    🪧 Tips

    Chat

    There are 3 ways to chat with CodeRabbit:

    • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
      • I pushed a fix in commit <commit_id>, please review it.
      • Explain this complex logic.
      • Open a follow-up GitHub issue for this discussion.
    • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
      • @coderabbitai explain this code block.
      • @coderabbitai modularize this function.
    • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
      • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
      • @coderabbitai read src/utils.ts and explain its main purpose.
      • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
      • @coderabbitai help me debug CodeRabbit configuration file.

    Support

    Need help? Create a ticket on our support page for assistance with any issues or questions.

    Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

    CodeRabbit Commands (Invoked using PR comments)

    • @coderabbitai pause to pause the reviews on a PR.
    • @coderabbitai resume to resume the paused reviews.
    • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
    • @coderabbitai full review to do a full review from scratch and review all the files again.
    • @coderabbitai summary to regenerate the summary of the PR.
    • @coderabbitai generate docstrings to generate docstrings for this PR.
    • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
    • @coderabbitai resolve resolve all the CodeRabbit review comments.
    • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
    • @coderabbitai help to get help.

    Other keywords and placeholders

    • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
    • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
    • Add @coderabbitai anywhere in the PR title to generate the title automatically.

    CodeRabbit Configuration File (.coderabbit.yaml)

    • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
    • Please see the configuration documentation for more information.
    • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

    Documentation and Community

    • Visit our Documentation for detailed information on how to use CodeRabbit.
    • Join our Discord Community to get help, request features, and share feedback.
    • Follow us on X/Twitter for updates and announcements.

    @Ryuk-me Ryuk-me changed the title Database version query feat: database version query Jun 11, 2025
    @Ryuk-me Ryuk-me force-pushed the database_version_query branch from c9e3d56 to 6972c7c Compare June 11, 2025 12:08
    @datachecks datachecks deleted a comment from qodo-code-review Bot Jun 11, 2025
    @datachecks datachecks deleted a comment from qodo-code-review Bot Jun 11, 2025
    @Ryuk-me

    Ryuk-me commented Jun 11, 2025

    Copy link
    Copy Markdown
    Member Author

    @coderabbitai full review

    @coderabbitai

    coderabbitai Bot commented Jun 11, 2025

    Copy link
    Copy Markdown
    ✅ Actions performed

    Full review triggered.

    @Ryuk-me Ryuk-me merged commit b2b09af into datachecks:main Jun 11, 2025
    4 of 6 checks passed
    @Ryuk-me Ryuk-me deleted the database_version_query branch June 11, 2025 12:14
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    1 participant